package br.usp.ime.protoc.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class ProtocProman implements EntryPoint {

    public static SimplePanel simplePanelMsg;
    public void onModuleLoad() {
        final RootPanel rootPanel = RootPanel.get();

        final VerticalPanel verticalPanel = new VerticalPanel();
        rootPanel.add(verticalPanel, 0, 0);
        verticalPanel.setSize("500px", "375px");

        final SimplePanel simplePanel = new SimplePanel();

        {
            final MenuBar menuBar = new MenuBar();
            verticalPanel.add(menuBar);

            final MenuBar menuBar_1 = new MenuBar(true);

            final MenuBar menuBar_2 = new MenuBar(true);

            menuBar_2.addItem("Consultar", new Command() {

                public void execute() {
                    simplePanel.clear();
                    simplePanelMsg.clear();
                    final ConsultaPaciente consultaPaciente = new ConsultaPaciente();
                    simplePanel.add(consultaPaciente);
                }
            });

            menuBar_2.addItem("Cadastrar", new Command() {

                public void execute() {
                    simplePanel.clear();
                    simplePanelMsg.clear();
                    final CadastroPaciente cadastroPaciente = new CadastroPaciente();
                    simplePanel.add(cadastroPaciente);
                }
            });

            menuBar_1.addItem("Paciente", menuBar_2);

            menuBar_2.addItem("Alterar", (Command) null);

            menuBar_2.addItem("Excluir", (Command) null);

            menuBar.addItem("Home", new Command() {

                public void execute() {
                    simplePanel.clear();
                }
            });

            final MenuItem menuItem = menuBar.addItem("Pessoas", menuBar_1);

            final MenuBar menuBar_3 = new MenuBar(true);

            menuBar_3.addItem("Consultar", new Command() {

                public void execute() {
                    simplePanel.clear();
                    simplePanelMsg.clear();
                    final ConsultaMedico consultaMedico = new ConsultaMedico();
                    simplePanel.add(consultaMedico);
                }
            });

            menuBar_3.addItem("Cadastrar", new Command() {

                public void execute() {
                    simplePanel.clear();
                    simplePanelMsg.clear();
                    final CadastroMedico cadastroMedico = new CadastroMedico();
                    simplePanel.add(cadastroMedico);
                }
            });

            menuBar_1.addItem("Medico", menuBar_3);

            menuBar_3.addItem("Alterar", (Command) null);

            menuBar_3.addItem("Excluir", (Command) null);

            final MenuBar menuBar_4 = new MenuBar(true);

            menuBar_4.addItem("Consultar", new Command() {

                public void execute() {
                    simplePanel.clear();
                    simplePanelMsg.clear();
                    final ConsultaParente consultaParente = new ConsultaParente();
                    simplePanel.add(consultaParente);
                }
            });

            menuBar_4.addItem("Cadastrar", new Command() {

                public void execute() {
                    simplePanel.clear();
                    simplePanelMsg.clear();
                    final CadastroParente cadastroParente = new CadastroParente();
                    simplePanel.add(cadastroParente);
                }
            });

            menuBar_4.addItem("Alterar", (Command) null);

            menuBar_4.addItem("Excluir", (Command) null);

            menuBar_1.addItem("Parente", menuBar_4);

            final MenuBar menuBar_5 = new MenuBar(true);

            menuBar_5.addItem("Consultar", new Command() {

                public void execute() {
                    simplePanel.clear();
                    simplePanelMsg.clear();
                    final ConsultaControle consultaControle = new ConsultaControle();
                    simplePanel.add(consultaControle);
                }
            });

            menuBar_5.addItem("Cadastrar", new Command() {

                public void execute() {
                    simplePanel.clear();
                    simplePanelMsg.clear();
                    final CadastroControle cadastroControle = new CadastroControle();
                    simplePanel.add(cadastroControle);
                }
            });

            menuBar_5.addItem("Alterar", (Command) null);

            menuBar_5.addItem("Excluir", (Command) null);

            menuBar_1.addItem("Controle", menuBar_5);
        }

        verticalPanel.add(simplePanel);

        simplePanelMsg = new SimplePanel();
        verticalPanel.add(simplePanelMsg);

    }

}
